package com.mazaiting.redisson.service.impl;

import com.mazaiting.redisson.service.IRedissonService;
import org.redisson.api.*;

import javax.annotation.Resource;

/**
 * Redis操作Service实现
 *
 * @author mazaiting
 * @create_time 2022/3/22 13:23
 */
public class RedissonServiceImpl implements IRedissonService {

    /**
     * 分布式锁工具
     */
    @Resource
    private RedissonClient redissonClient;

    @Override
    public <T> RBucket<T> getBucket(String key) {
        return redissonClient.getBucket(key);
    }

    @Override
    public <K, V> RMap<K, V> getMap(String key) {
        return redissonClient.getMap(key);
    }

    @Override
    public <V> RSortedSet<V> getSortedSet(String key) {
        return redissonClient.getSortedSet(key);
    }

    @Override
    public <V> RSet<V> getSet(String key) {
        return redissonClient.getSet(key);
    }

    @Override
    public <V> RList<V> getList(String key) {
        return redissonClient.getList(key);
    }

    @Override
    public <V> RQueue<V> getQueue(String key) {
        return redissonClient.getQueue(key);
    }

    @Override
    public <V> RDeque<V> getDeque(String key) {
        return redissonClient.getDeque(key);
    }

    @Override
    public RLock getLock(String key) {
        return redissonClient.getLock(key);
    }

    @Override
    public RReadWriteLock getRwLock(String key) {
        return redissonClient.getReadWriteLock(key);
    }

    @Override
    public RAtomicLong getAtomicLong(String key) {
        return redissonClient.getAtomicLong(key);
    }

    @Override
    public RCountDownLatch getCountDownLatch(String key) {
        return redissonClient.getCountDownLatch(key);
    }

    @Override
    public RTopic getTopic(String key) {
        return redissonClient.getTopic(key);
    }

}
